use axum::{
    middleware, routing::post, Router
};

mod master;

pub fn routes() -> Router{
    Router::new()
    .route("/backup_table", post(master::backup_table))
    .route("/backup_database", post(master::backup_database))
    .route("/import_table_sql", post(master::import_table_sql))
    .route("/backup_mongo", post(master::backup_mongo))

    .route_layer(middleware::from_fn(com::perm::admin::auth))
    .route("/backup_all_mongo", post(master::backup_all_mongo))
}
